<%@ page language="java" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!doctype html>
<html lang="en">

<head>
	<title>Home</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<!-- VENDOR CSS -->
	<link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.min.css">
	<link rel="stylesheet" href="assets/vendor/linearicons/style.css">
	<link rel="stylesheet" href="assets/vendor/chartist/css/chartist-custom.css">
	<!-- MAIN CSS -->
	<link rel="stylesheet" href="assets/css/main.css">
	<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
	<link rel="stylesheet" href="assets/css/demo.css">
	<!-- GOOGLE FONTS -->
	<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
	<!-- ICONS -->
	<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
	<link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicon.png">
</head>
<script type="text/javascript">
		function addclient() {
			 /*var data = $("#form1").serializeArray();
			 alert(data);*/
			 
            $.ajax({
            //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "/chuan/doAddCustomer.do" ,//url
                data: $('#form1').serializeArray(),
                success: function (result) {
                	
                	if (result.returncode == "success") {
                		 $.MsgBox.Confirm("温馨提示", "客户增加成功", function(){window.location.href="/chuan/addClient.do";});
                    }
                    ;
                },
                error: function(XMLHttpRequest, textStatus, errorThrown){
                	alert("执行失败");
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                 }
            });
        }
	</script>
<body>
	
		<jsp:include page="/assets/jsp/header.jsp" flush="true"/>
		<jsp:include page="/assets/jsp/menu.jsp" flush="true"/>

		<!-- MAIN -->
		<div class="main">
			<!-- MAIN CONTENT -->
				
				<form class="form-horizontal" role="form" action="##" id="form1" method="post">
                    <fieldset>
                    <legend></legend>
                       <div class="form-group">
                          <label class="col-sm-2 control-label" for="customer_number">客户号</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="customer_number"  name ="customer_number"  type="text" placeholder="请输入客户号"/>
                          </div>
          
                          <label class="col-sm-2 control-label" for="customer_name">客户名称</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="customer_name"  name="customer_name" type="text" placeholder="请输入客户名称"/>
                          </div>
                       </div>
                       <div class="form-group">
                          <label class="col-sm-2 control-label" for="customer_id_type">证件类型</label>
                         <div class="col-sm-4">
                              <select id="customer_id_type"  name="customer_id_type" class="form-control">
                                 <option value="01">01-身份证</option>
                                 <option value="02">02-护照</option>
                                 <option value="03">03-驾照</option>
                                 <option value="04">04-其他</option>
                              </select>
                           </div>
                          <label class="col-sm-2 control-label" for="customer_idno">证件号</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="customer_idno" name="customer_idno" type="text" placeholder="请输入证件号"/>
                          </div>
                       </div>
                        <div class="form-group">
                          <label class="col-sm-2 control-label" for="customer_phone">手机号</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="customer_phone" name="customer_phone" type="text" placeholder="请输入手机号"/>
                          </div>
                          <label class="col-sm-2 control-label" for="customer_email">邮箱</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="customer_email" name="customer_email" type="text" placeholder="请输入客户邮箱"/>
                          </div>
                        </div>
                        <div class="form-group">
                        	 <label class="col-sm-2 control-label" for="customer_address">地址</label>
                        	  <div class="col-sm-4">
                             <input class="form-control" id="customer_address" name="customer_address" type="text" placeholder="请输入di zhi"/>
                          </div>
                        </div>
                        
                    </fieldset>     
                    <fieldset>
                    <legend></legend>
                    	 <div class="form-group">
                          <label class="col-sm-2 control-label" for="submit"></label>
                          <div class="col-sm-4">
                         	<input type="button" class="btn btn-default" onclick="addclient()" value="提交"/>
                         	</div>
                           </div>
                    </fieldset>     
                </form>
			<!-- END MAIN CONTENT -->
		</div>
		<!-- END MAIN -->
		<div class="clearfix">
		<footer>
			<div class="container-fluid">
				<p class="copyright">Copyright &copy; 2018.Company  ShanChuanli  All rights reserved.More Templates </p>
				
			</div>
		</footer>
	 </div>
	</div>
		<!-- END WRAPPER -->
	<!-- Javascript -->
	<script src="assets/vendor/jquery/jquery.min.js"></script>
	<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script src="assets/vendor/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<script src="assets/vendor/jquery.easy-pie-chart/jquery.easypiechart.min.js"></script>
	<script src="assets/vendor/chartist/js/chartist.min.js"></script>
	<script src="assets/scripts/klorofil-common.js"></script>
		<script src="assets/scripts/common.js"></script>
	
	<script type="text/javascript">
	
	$("#subPages1").addClass("in");
	</script>
</body>

</html>
